package net.sxnic.jhitem.itemoperation.taglib;

import java.io.IOException;

import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

import net.sxnic.comm.utils.CommUtils;
import net.sxnic.item.ItemConstants;

import org.apache.commons.lang.StringUtils;

/**
 * 组织单位根据编码显示名称 
 * @desp deptCodes单位编码可以是一个，也是可以多个，必选项
 * @author 孙宇飞
 *
 */
public class OperationNameTag extends BodyTagSupport{

	private static final long serialVersionUID = -3620111839909951992L;
	
	private String soperCode;
	
	public int doEndTag() {
		JspWriter out = pageContext.getOut();
		try {
			if (StringUtils.isBlank(soperCode)) {
				out.print("");
			} else {

				String temp = ItemConstants.OPERATION_SHORTNAME_MAP.get(soperCode);
				
				if(StringUtils.isNotBlank(temp))
					out.print(temp);
				else
					out.print("");
			}

		} catch (IOException e) {
			
		}
		return EVAL_PAGE;
	}

	public String getSoperCode() {
		return soperCode;
	}

	public void setSoperCode(String soperCode) {
		this.soperCode = soperCode;
	}
}
